﻿
<div>
    <form name="gridPersonCreateOrEditForm" role="form" novalidate class="form-validation">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.gridPerson.id">编辑信息:{{vm.gridPerson.name}}</span>
                <span ng-if="!vm.gridPerson.id">新增信息</span>
            </h4>
        </div>
        <div class="modal-body">


            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="PersonName" ng-class="{'edited':vm.gridPerson.personName}" ng-model="vm.gridPerson.personName" maxlength="50" required />
                <label>@L("PersonName")</label>
                <span class="help-block">     @L("PersonName")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="PersonPhone" ng-class="{'edited':vm.gridPerson.personPhone}" ng-model="vm.gridPerson.personPhone" maxlength="11" required ng-pattern="/(^$)|^(((\+86)|(86))?1[34578]\d{9})$/" />
                <label>@L("PersonPhone")</label>
                <span class="help-block" ng-show="gridPersonCreateOrEditForm.PersonPhone.$error.required">     @L("PersonPhone")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!gridPersonCreateOrEditForm.PersonPhone.$error.required&&gridPersonCreateOrEditForm.PersonPhone.$invalid">     @L("PleaseEnterTheCorrectType")@L("PersonPhone")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="IDCard" ng-class="{'edited':vm.gridPerson.idCard}" ng-model="vm.gridPerson.idCard" maxlength="18" required ng-pattern="/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/" />
                <label>@L("IDCard")</label>
                <span class="help-block" ng-show="gridPersonCreateOrEditForm.IDCard.$error.required">     @L("IDCard")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!gridPersonCreateOrEditForm.IDCard.$error.required&&gridPersonCreateOrEditForm.IDCard.$invalid">     @L("PleaseEnterTheCorrectType")@L("IDCard")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="CensusRegister" ng-class="{'edited':vm.gridPerson.censusRegister}" ng-model="vm.gridPerson.censusRegister" maxlength="500" required />
                <label>@L("CensusRegister")</label>
                <span class="help-block">     @L("CensusRegister")@L("MustBe_Required")</span>
            </div>
            

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="GridName" ng-class="{'edited':vm.gridPerson.gridName}" ng-model="vm.gridPerson.gridName" maxlength="50" required />
                <label>@L("GridName")</label>
                <span class="help-block">     @L("GridName")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="GridPhone" ng-class="{'edited':vm.gridPerson.gridPhone}" ng-model="vm.gridPerson.gridPhone" maxlength="11" required ng-pattern="/(^$)|^(((\+86)|(86))?1[34578]\d{9})$/" />
                <label>@L("GridPhone")</label>
                <span class="help-block" ng-show="gridPersonCreateOrEditForm.GridPhone.$error.required">     @L("GridPhone")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!gridPersonCreateOrEditForm.GridPhone.$error.required&&gridPersonCreateOrEditForm.GridPhone.$invalid">     @L("PleaseEnterTheCorrectType")@L("GridPhone")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="AssistName" ng-class="{'edited':vm.gridPerson.assistName}" ng-model="vm.gridPerson.assistName" maxlength="50" required />
                <label>@L("AssistName")</label>
                <span class="help-block">     @L("AssistName")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="AssistPhone" ng-class="{'edited':vm.gridPerson.assistPhone}" ng-model="vm.gridPerson.assistPhone" maxlength="11" required ng-pattern="/(^$)|^(((\+86)|(86))?1[34578]\d{9})$/" />
                <label>@L("AssistPhone")</label>
                <span class="help-block" ng-show="gridPersonCreateOrEditForm.AssistPhone.$error.required">     @L("AssistPhone")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!gridPersonCreateOrEditForm.AssistPhone.$error.required&&gridPersonCreateOrEditForm.AssistPhone.$invalid">     @L("PleaseEnterTheCorrectType")@L("AssistPhone")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="TownID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.gridPerson.personTypeID" required>
                    <option ng-repeat="x in vm.personTypeList" value="{{x.id}}" ng-selected="vm.gridPerson.personTypeID==x.id">{{x.name}}</option>
                </select>
                <label>@L("PersonTypeTitle")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <div class="md-checkbox-list">
                    <div class="md-checkbox">
                        <input id="EditGridPerson_IsArmy" class="md-check" type="checkbox" name="IsArmy" ng-model="vm.gridPerson.isArmy">
                        <label for="EditGridPerson_IsArmy">
                            <span class="inc"></span>
                            <span class="check"></span>
                            <span class="box"></span>
                            @L("IsArmy")
                        </label>
                    </div>
                </div>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="TownID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.gridPerson.townID" ng-change="vm.bindArea(vm.gridPerson.townID)" required>
                    <option ng-repeat="x in vm.townList" value="{{x.id}}" ng-selected="vm.gridPerson.townID==x.id">{{x.title}}</option>
                </select>
                <label>@L("TownID")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="AreaID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.gridPerson.areaID" ng-change="vm.bindVillage(vm.gridPerson.areaID)" required>
                    <option ng-repeat="x in vm.areaList" value="{{x.id}}" ng-selected="vm.gridPerson.areaID==x.id">{{x.title}}</option>
                </select>

                <label>@L("AreaID")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="VillageID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.gridPerson.villageID" required>
                    <option ng-repeat="x in vm.villageList" value="{{x.id}}" ng-selected="vm.gridPerson.villageID==x.id">{{x.title}}</option>
                </select>
                <label>@L("VillageID")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" class="form-control" name="Address" ng-class="{'edited':vm.gridPerson.address}" ng-model="vm.gridPerson.address" maxlength="500" required />
                <label>@L("Address")</label>
                <span class="help-block">     @L("Address")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" class="form-control" name="WordSituation" ng-class="{'edited':vm.gridPerson.wordSituation}" ng-model="vm.gridPerson.wordSituation" maxlength="500" required />
                <label>@L("WordSituation")</label>
                <span class="help-block">     @L("WordSituation")@L("MustBe_Required")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <label>备注</label>
                <div class="ueditor" ng-model="vm.gridPerson.remarks" style="width: 100%;"></div>
            </div>


        </div>
        <div class="modal-footer">
            <button ng-disabled="vm.saving" type="button" class="btn btn-default" ng-click="vm.cancel()">@L("Cancel")</button>
            <button type="submit" button-busy="vm.saving" busy-text="@L("SavingWithThreeDot")" class="btn btn-primary blue" ng-click="vm.save()" ng-disabled="gridPersonCreateOrEditForm.$invalid"><i class="fa fa-save"></i> <span>@L("Save")</span></button>
        </div>
    </form>
</div>